package lab02.test06;

public class Circle {
    double radius;    //圆的半径
    double area;             //圆的面积
    double perimeter;      //圆的周长
    final double PI = 3.1415926;

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public double getArea() {
        return (PI * radius * radius);     //计算面积
    }

    public double getPerimeter() {         //计算周长
        return (2 * PI * radius);
    }
}
